<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<title>欢迎登陆！</title>
<style type="text/css">
* {
  padding: 0;
  margin: 0;
  font-family: "微软雅黑";
}
/*右边登陆框开始*/
.gcs-login {
  position: absolute;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  background-color: #E6E6E6;
  z-index: 100;
}
.gcs-login .gcs-login-panel{
 height: 360px;
  position:absolute;
  margin:auto;
  left: 0;
  right: 0;
  top:0;
  bottom: 0;
}
.gcs-login .login-title {
  text-align: center;
  color: #62a8ea;
}
.gcs-login .login-title h2 {
  letter-spacing: 10px;
}
.gcs-login-container {
  width: 100%;
  box-sizing: border-box;
  width: 100%;
  margin: 20px 0 0;
  text-align: center;
}
.gcs-login .input {
  border: 1px solid white;
  display: inline-block;
  box-sizing: border-box;
  width: 20%;
  height: 46px;
  padding-left: 10px;
  margin: 0 auto;
  font-size: 14px;
  outline: none;
  color:  #76838f;
}
.gcs-login .gcs-login-validation{
  width:80%;
  margin: 0 auto;
  position: relative;
}
.gcs-login .validation-input{
  position: absolute;
  width: 250px;
  left: 0px;
}
.gcs-login img.validation-img{
  position: absolute;
  cursor:pointer;
  width: 125px;
  height: 45px;
  right: 35%;
}
.gcs-login .input:focus {
  outline: none;
  border: 1px solid #62a8ea;
}
.gcs-login .btn-login {
  background-color: #62a8ea;
 border: none;
  width: 20%;
  height: 45px;
  line-height: 45px;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}
.gcs-login .btn-login:hover{
  opacity: 0.9;
}
/*右边登陆框结束*/
</style>
</head>
<body>
<script type="text/javascript" src="js/common/jquery.min.js"></script>
<div>
	<div class='gcs-login'>
	    <div class="gcs-login-panel">
			<div class="login-title">
				<h2>用户登陆</h2>
			</div>
			
			<div class="gcs-login-container">
			  <input type="text" class="input" id="userName" placeholder="请输入用户名" />
			</div>
			<div class="gcs-login-container">
			  <input type="password"  class="input" id="pwd"  placeholder="请输入密码"/>
			</div>
			
			<br />
			<br />
			<div class="gcs-login-container">
				<input type="button" value="立即登录" onclick="login()" class="btn-login" />
			</div>
			<br />
			<div class="gcs-login-container">
				<a href="/web_seach/goRegister">注册</a>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	function login(){
		var obj={};
		obj.userName =$("#userName").val();
		obj.pwd =$("#pwd").val();
		
		if(obj.userName=='' || obj.pwd==''){
			alert('用户名密码是必输项');
			return false;
		}
		var url = "/web_seach/login/check";
		
		
		$.post(url,obj,function(data){
			data = JSON.parse(data);
			if(data.id > 0){
				window.location.href="/web_seach/index";
	        }else{
	            alert("登录失败！");
	        }
		  });
	}
</script>
</body>
</html>